Ext.define('appmod.view.knowledge.category.UserGroupPermList', {
    extend: 'Ext.grid.Panel',
    alias: [
		'widget.knowledge.category.usergrouppermlist',
		'widget.knowledge-category-usergrouppermlist'
		
	],
    margins:"5 5 5 5",
    region : 'center',
	requires:[
		'Ext.ux.form.SearchField',
		'Ext.ux.CheckColumn'
	],	

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            columns: [
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'groupName',
					minWidth:100,
                    text: '用户组'
                },
				{
					xtype : 'gridcolumn',
					text: '知识分类',
					columns : [
					{
						xtype:'checkcolumn',
						stopSelection: false,
						dataIndex: 'cateAdding',						
						text:'新增',
						width:40
					},
					{
						xtype:'checkcolumn',
						stopSelection: false,						
						dataIndex: 'cateEditing',
						text:'修改',
						width:40
					},
					{
						xtype:'checkcolumn',
						stopSelection: false,						
						dataIndex: 'cateDeleting',
						text:'删除',
						width:40
					}
					/*
					,
					{
						xtype:'checkcolumn',
						stopSelection: false,
						dataIndex: 'onlyGroupCateView',						
						text:'同组访问',
						width:60
					}
					*/										
					]			
				},
				{
					xtype : 'gridcolumn',
					text: '知识点/附件权限',
					columns : [{
						xtype:'checkcolumn',
						stopSelection: false,
						dataIndex: 'kmAdding',
						text:'新增',
						width:40
					},
					{
						xtype:'checkcolumn',
						stopSelection: false,
						dataIndex: 'kmEditing',
						text:'修改',
						width:40
					},
					{
						xtype:'checkcolumn',
						stopSelection: false,
						dataIndex: 'kmDeleting',						
						text:'删除',
						width:40
					},
					{
						xtype:'checkcolumn',
						stopSelection: false,
						dataIndex: 'kmView',						
						text:'访问',
						width:40
					}										
					]			
				},
				{
					xtype : 'checkcolumn',
					text: '栏目管理员',
					dataIndex: 'isAdmin',
					width:80
				}				 				
            ],
            viewConfig: {

            },
			plugins: [
				Ext.create('Ext.grid.plugin.CellEditing', {
					clicktoEdit:2
    			})
			],			
            dockedItems: [
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
						{
					        width: 250,
					        fieldLabel: '用户组查询',
					        labelWidth: 70,
					        xtype: 'searchfield',
							store : me.store
				        },'-',
                        {
							text:'保 存',
							action:'updateUserGroupAuth' 
                        }												
                    ]
                }
            ],
			listeners:{
				
			}
        });

        me.callParent(arguments);
    },
	
	bindStore:function(store) {
		var me = this;
		
		var pagingbar = me.down('pagingtoolbar');
		pagingbar.bindStore(store);
		
		var searchField = me.down('searchfield');
		searchField.bindStore(store);
		me.callParent(arguments);		
	}
	
	
	
	
});